/*
 * Copyright 1999-2011 Alibaba Group.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.winit.cloudlink.common;

import com.winit.cloudlink.common.compress.Compress;

import java.util.concurrent.ExecutorService;
import java.util.regex.Pattern;
import java.util.zip.Deflater;

/**
 * Constants
 *
 * @author Steven.Liu
 */
public class Constants {

    public static final String DEFAULT_CHARSET = "UTF-8";

    public static final int DEFAULT_TIMEOUT = 1000;

    public static final int DEFAULT_REGISTRY_CONNECT_TIMEOUT = 5000;

    public static final String DEFAULT_KEY_PREFIX = "default.";

    public static final String ANYHOST_KEY = "anyhost";

    public static final String ANYHOST_VALUE = "0.0.0.0";

    public static final String LOCALHOST_KEY = "localhost";

    public static final String TIMEOUT_KEY = "timeout";

    public static final Pattern COMMA_SPLIT_PATTERN = Pattern.compile("\\s*[,]+\\s*");

    public final static String PATH_SEPARATOR = "/";

    public static final Pattern REGISTRY_SPLIT_PATTERN = Pattern.compile("\\s*[|;]+\\s*");

    public static final String SESSION_TIMEOUT_KEY = "session";

    public static final int DEFAULT_SESSION_TIMEOUT = 60 * 1000;

    public static final String BACKUP_KEY = "backup";

    public static final boolean DEFAULT_COMPRESSION_ENABLED = false;

    public static final Compress.CompressCodec DEFAULT_COMPRESSION_CODEC = Compress.CompressCodec.ZLIB;

    public static final int DEFAULT_COMPRESSION = Deflater.BEST_COMPRESSION;

    public static final int DEFAULT_NO_COMPRESSION_SIZE = 1024 * 100;//

    public static final boolean DEFAULT_MESSAGE_SIZE_LIMITED = true;

    public static final int DEFAULT_MESSAGE_WARN_BYTES = 1024 * 1024 * 1;  //1M,缺省消息载体体积警告阈值

    public static final int DEFAULT_MESSAGE_MAX_BYTES = 1024 * 1024 * 10;   //10M,缺省消息体载体体积最大阈值

    public static final int MESSAGE_SUMMARY_LENGTH = 1024;

    /*
     * private Constants(){ }
     */

}
